#!/bin/bash
err() { echo Error. $@ not found.; exit 1; }

cp deploy-rootfs.tcl /opt/armgcc/deploy
cd /opt/armgcc/deploy

[ -z `which sam-ba` ] && err sam-ba
[ ! -c /dev/ttyUSB0 ] && err /dev/ttyUSB0
[ ! -f rootfs.bin ] && err rootfs.bin

sam-ba /dev/ttyUSB0 AT91SAM9263-EK deploy-rootfs.tcl
